﻿using System;
using System.Collections.Generic;
using System.Text;

using YouHP.BLL;
using YouHP.Model;
using YouHP.Utility;

namespace YouHP.Pages.User
{
    public class Index: YouHP.Pages.User.UserBasePage
    {
        protected UserInfo _User = null;
        protected string province;
        protected string city;
        protected int   viewMode = -1;
        protected PatientRecordInfo RecorderInfo;
        
        protected override void ShowPage()
        {
            viewMode = RequestTools.GetQueryInt("showMode", Constants.DEFAULTMODE);
            base.ShowPage();
            this.SetTitle("病情系统");

            if (ErrorCount > 0) 
                return;

            _User = UserBLL.Instance.GetUserInfo(UserData.Id);

            DistrictInfo info = DistrictBLL.Instance.GetDistrict(_User.ProvinceId);
            DistrictInfo info1 = DistrictBLL.Instance.GetDistrict(_User.CityId);
            province = info.Name;
            city = info1.Name;
            if ((_User.UserTypeId & Constants.USER_TYPE_MASK) == 1)
            {
                RecorderInfo = PatientBLL.Instance.GetPatientRecordInfo(_User.Id);
                DiseaseInfo DiseaseInfo = DiseaseBLL.Instance.GetDiseaseInfo(RecorderInfo.DiseaseId);
                RecorderInfo.DiseaseName = DiseaseInfo.Name;

            }
        }
    }
}
